package com.ruoyi.forum.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.forum.mapper.ForumSpecialtyMapper;
import com.ruoyi.forum.domain.ForumSpecialty;
import com.ruoyi.forum.service.IForumSpecialtyService;

/**
 * 专业管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-01
 */
@Service
public class ForumSpecialtyServiceImpl implements IForumSpecialtyService 
{
    @Autowired
    private ForumSpecialtyMapper forumSpecialtyMapper;

    /**
     * 查询专业管理
     * 
     * @param id 专业管理主键
     * @return 专业管理
     */
    @Override
    public ForumSpecialty selectForumSpecialtyById(Long id)
    {
        return forumSpecialtyMapper.selectForumSpecialtyById(id);
    }

    /**
     * 查询专业管理列表
     * 
     * @param forumSpecialty 专业管理
     * @return 专业管理
     */
    @Override
    public List<ForumSpecialty> selectForumSpecialtyList(ForumSpecialty forumSpecialty)
    {
        return forumSpecialtyMapper.selectForumSpecialtyList(forumSpecialty);
    }

    /**
     * 新增专业管理
     * 
     * @param forumSpecialty 专业管理
     * @return 结果
     */
    @Override
    public int insertForumSpecialty(ForumSpecialty forumSpecialty)
    {
        forumSpecialty.setCreateTime(DateUtils.getNowDate());
        return forumSpecialtyMapper.insertForumSpecialty(forumSpecialty);
    }

    /**
     * 修改专业管理
     * 
     * @param forumSpecialty 专业管理
     * @return 结果
     */
    @Override
    public int updateForumSpecialty(ForumSpecialty forumSpecialty)
    {
        forumSpecialty.setUpdateTime(DateUtils.getNowDate());
        return forumSpecialtyMapper.updateForumSpecialty(forumSpecialty);
    }

    /**
     * 批量删除专业管理
     * 
     * @param ids 需要删除的专业管理主键
     * @return 结果
     */
    @Override
    public int deleteForumSpecialtyByIds(Long[] ids)
    {
        return forumSpecialtyMapper.deleteForumSpecialtyByIds(ids);
    }

    /**
     * 删除专业管理信息
     * 
     * @param id 专业管理主键
     * @return 结果
     */
    @Override
    public int deleteForumSpecialtyById(Long id)
    {
        return forumSpecialtyMapper.deleteForumSpecialtyById(id);
    }
}
